def xor_binary_decimal(a, b):
    # 将两个小数转换为二进制字符串
    bin_a = format(a, ".20f").split(".")[1]
    bin_b = format(b, ".20f").split(".")[1]

    # 为了方便，将两个二进制字符串补齐到相同的长度
    length = max(len(bin_a), len(bin_b))
    bin_a = bin_a.ljust(length, '0')
    bin_b = bin_b.ljust(length, '0')

    # 对于每一位，将两个二进制数进行异或操作
    bin_c = ''.join([str(int(bin_a[i]) ^ int(bin_b[i])) for i in range(length)])

    # 将异或结果转换为小数
    result = int(bin_c, 2) / (2 ** length)

    return result

if __name__ == '__main__':
    a = 0.15
    b = 0.43
    r = xor_binary_decimal(a,b)
    print(r)
